export function errorParse(err) {
  if (err && err.message.includes('Invalid Token'))
    return 'Invalid Token'
  if (err && err.message.includes('Invalid Offer Token'))
    return 'Invalid Offer Token'
  if (err && err.message.includes('User rejected the request'))
    return 'User rejected the request'
  if (err && err.message.includes('Invalid Amount or Value'))
    return 'Invalid Amount or Value'
  if (err && String(err).includes('Insufficient Funds'))
    return 'Insufficient Funds'
  if (err && String(err).includes('Invalid Offer Status'))
    return 'Invalid Offer Status'
  if (err && String(err).includes('Invalid token Status'))
    return 'Invalid token Status'
  if (err && String(err).includes('Insufficient Allocations'))
    return 'Insufficient Allocations'
  if (err && String(err).includes('FullMatch required'))
    return 'FullMatch required'
  if (err && String(err).includes('Offer Owner Only'))
    return 'Offer Owner Only'
  if (err && String(err).includes('Transfer Funds Fail'))
    return 'Transfer Funds Fail'
  if (err && String(err).includes('Invalid Status'))
    return 'Invalid Status'
  if (err && String(err).includes('Token Not Set'))
    return 'Token Not Set'
  if (err && String(err).includes('Settling Time Not Started'))
    return 'Settling Time Not Started'
  if (err && String(err).includes('Seller Only'))
    return 'Seller Only'
  if (err && String(err).includes('Invalid Order Status'))
    return 'Invalid Order Status'
  if (err && String(err).includes('Invalid Address'))
    return 'Invalid Address'
  if (err && String(err).includes('Settling Time Not Ended Yet'))
    return 'Settling Time Not Ended Yet'
  if (err && String(err).includes('Buyer or Operator Only'))
    return 'Buyer or Operator Only'
  if (err && String(err).includes('Settle Fee <= 10%'))
    return 'Settle Fee <= 10%'
  if (err && String(err).includes('Cancel Fee <= 10%'))
    return 'Cancel Fee <= 10%'
  if (err && String(err).includes('Invalid Token Address'))
    return 'Invalid Token Address'
  if (err && String(err).includes('Initialize: adminAddress is the zero address'))
    return 'Initialize: adminAddress is the zero address'
  if (err && String(err).includes('Initialize: feeWalletAddress is the zero address'))
    return 'Initialize: feeWalletAddress is the zero address'
  if (err && String(err).includes('createToken: Minimum 24h for settling'))
    return 'createToken: Minimum 24h for settling'
  if (err && String(err).includes('createToken: Token already exists'))
    return 'createToken: Token already exists'
  if (err && String(err).includes('tokenToSettlePhase: Invalid Token Address'))
    return 'tokenToSettlePhase: Invalid Token Address'
  if (err && String(err).includes('tokenToSettlePhase:Invalid Settle Rate'))
    return 'tokenToSettlePhase:Invalid Settle Rate'
  if (err && String(err).includes('tokenToSettlePhase:Invalid Token Status'))
    return 'tokenToSettlePhase:Invalid Token Status'
  if (err && String(err).includes('Cannot Change Token Status'))
    return 'Cannot Change Token Status'
  if (err && String(err).includes('Minimum 24h for settling'))
    return 'Minimum 24h for settling'
  if (err && String(err).includes('Transfer Funds to Seller Fail'))
    return 'Transfer Funds to Seller Fail'
  if (err && String(err).includes('Token Not Set'))
    return 'Token Not Set'
  if (err && String(err).includes('Invalid Input'))
    return 'Invalid Input'
  return err;
}